package com.xykj.enterprise.wechat.event.service.ext;

import com.xykj.enterprise.wechat.bean.ext.identity.AccessToken;
import com.xykj.enterprise.wechat.event.config.ExtClient;

import java.util.HashMap;
import java.util.Map;

/**
 * access_token 工具
 *
 * @Author zhouxu
 * @create 2021-04-02 16:51
 */

public class AccessTokenUtil {

    /**
     * access_token
     *
     * @param extClient
     * @param suiteAccessToken
     * @param authCorpId
     * @param permanentCode
     * @return
     */
    public static AccessToken get(ExtClient extClient, String suiteAccessToken, String authCorpId, String permanentCode) {
        Map param = new HashMap();
        param.put("suite_access_token", suiteAccessToken);
        param.put("auth_corpid", authCorpId);
        param.put("permanent_code", permanentCode);
        return extClient.get("GetAccessToken", param, AccessToken.class);
    }
}
